/**
 * 
 */
package com.ksframework.security.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.ksframework.common.entity.BaseEntity;

/**
 * @description
 * @author ssocenter
 * @date 2011-8-26
 */
@SuppressWarnings("serial")
@Entity
@Table(name="security_resource")
public class Resource extends BaseEntity {
	private String name;
	private String url;
	private String description;
	private Set<Role> role = new HashSet<Role>();
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	@ManyToMany(mappedBy="resources",targetEntity=Role.class,fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	public Set<Role> getRole() {
		return role;
	}
	public void setRole(Set<Role> role) {
		this.role = role;
	}
}
